<?php

die('stop in '.__CLASS__.__FUNCTION__);

//本地开发及内网测试环境
define('DEVELOPMENT', "\\" == DIRECTORY_SEPARATOR || 
	in_array($_SERVER['SERVER_ADDR'],array('172.26.40.50', '172.27.128.4')));
	
//外网测试环境	
define('TEST_ENV', in_array($_SERVER['SERVER_ADDR'],array('183.61.6.12', '183.61.6.13')));		
define('STORAGE_TEST', false);
define('REWRITE', true);


$commonConfig = array(
    'app_id' => 'video.hehe',
    'storage' => array(
        '_clusters' => array('http://imageservice.dwstatic.com/api_storage.php'), //新的
        '_try_connect_max' => 5, // 链接重试次数
        '_tmp_dir' => '/tmp', // 临时目录
        '_group_name' => 'vhuya',// 默认组名
        '_remote_url'  => 'http://s1.dwstatic.com',// 远程配置
    ),
    'rewrite' => array(
        'http://'.$_SERVER['HTTP_HOST'].'/<c>/<a>' => '<c>/<a>',
    ),
);

if(DEVELOPMENT) {  // 开发环境&&内网测试环境   
	define('DEBUG', true);
	define('DWAE_MMC_HOST_1', '172.27.128.4');
	define('DWAE_MMC_PORT_1', 11212);

	return array_merge($commonConfig, array(
		'mysql' => array(
			'MYSQL_HOST' => '183.61.6.96',
			'MYSQL_PORT' => '6301',
			'MYSQL_USER' => 'video_dw',
			'MYSQL_DB'   => 'video_dw',
			'MYSQL_PASS' => '3nV4FfXwjFIPDAff',
			'MYSQL_CHARSET' => 'utf8',
		),
		'redis'=>array(
			'host'=>'172.27.128.4',
			'port'=>'6380',
		),
	    'api' => array(
            // 'xxx' => ...
        ),
	));

} else if(TEST_ENV){ //外网测试环境
	define('DEBUG', true);
	define('DWAE_MMC_HOST_1', '183.61.6.99');
	define('DWAE_MMC_PORT_1', '11224');
	
	return array_merge($commonConfig, array(
		'mysql' => array(
			'MYSQL_HOST' => '183.61.6.96',
			'MYSQL_PORT' => '6301',
			'MYSQL_USER' => 'video_dw',
			'MYSQL_DB'   => 'video_dw',
			'MYSQL_PASS' => '3nV4FfXwjFIPDAff',
			'MYSQL_CHARSET' => 'utf8',
		),
		'redis'=>array(
			'host'=>'183.61.6.99',
			'port'=>'6390',
		),
	    'api' => array(
            // 'xxx' => ...
        ),
	));	
}else{  //正式环境
	define('DEBUG', true);
	define('DWAE_MMC_HOST_1', '10.20.170.165');
	define('DWAE_MMC_PORT_1', '11212');
	define('DWAE_MMC_HOST_2', '10.20.170.166');
	define('DWAE_MMC_PORT_2', '11212');

	return array_merge($commonConfig, array(
		'mysql' => array(
			'MYSQL_HOST' => '115.238.171.70', //原221.228.79.52
			'MYSQL_PORT' => '6304',
			'MYSQL_USER' => 'video_dw_rw',
			'MYSQL_DB' => 'video_dw',
			'MYSQL_PASS' => 'R02K,Th8K+DP',
			'MYSQL_CHARSET' => 'utf8',
		),
		'redis'=>array(
			'host'=>'10.20.170.165',
			'port'=>'6380',
		),	
	    'api' => array(
            // 'xxx' => ...
        ),
	));	
}